<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class UpdatePasswordAdminsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('admins', function (Blueprint $table) {


            $table->string('password', 32)->nullable(false)->comment('密码')->change();

            $table->string('nick_name')->comment('昵称')->default('');

            $table->string('head')->comment('头像')->default('');

            $table->integer('last_login_time')->unsigned()->comment('上一次登录时间')->default(0);


        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('admins', function (Blueprint $table) {
            //
            $table->string('password', 32)->change();

            $table->dropColumn('nick_name');
            $table->dropColumn('head');
            $table->dropColumn('last_login_time');

        });
    }
}
